package com.aaa.service.impl;

import com.aaa.dao.LogDao;
import com.aaa.entity.Log;
import com.aaa.service.LogService;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class LogServiceImpl implements LogService {
    @Autowired
    private LogDao logDao;

    /**
    * @Author: WTH
    * @Description: 查询,分页
    * @Date:2022-07-04 19:56
    * @Params:
    */
    @Override
    public Page<Log> selectLog(Log log) {
        Page<Log> objects = PageHelper.startPage(log.getPage(), log.getLimit());
        List<Log> logs = logDao.selectLog(log);
        Page log1= (Page) logs;
        return log1;
    }

    /**
    * @Author: WTH
    * @Description: 新增
    * @Date:2022-07-06 17:17
    * @Params:
    */
    @Override
    public int addLog(Log log) {
        int i = logDao.addLog(log);
        return i;
    }
}
